/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package suministros.ejb30.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Diana
 */
@Embeddable
public class ProveedorSuministroPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ruc")
    private String ruc;
    @Basic(optional = false)
    @Column(name = "id_suministro")
    private String idSuministro;

    public ProveedorSuministroPK() {
    }

    public ProveedorSuministroPK(String ruc, String idSuministro) {
        this.ruc = ruc;
        this.idSuministro = idSuministro;
    }

    public String getRuc() {
        return ruc;
    }

    public void setRuc(String ruc) {
        this.ruc = ruc;
    }

    public String getIdSuministro() {
        return idSuministro;
    }

    public void setIdSuministro(String idSuministro) {
        this.idSuministro = idSuministro;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ruc != null ? ruc.hashCode() : 0);
        hash += (idSuministro != null ? idSuministro.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProveedorSuministroPK)) {
            return false;
        }
        ProveedorSuministroPK other = (ProveedorSuministroPK) object;
        if ((this.ruc == null && other.ruc != null) || (this.ruc != null && !this.ruc.equals(other.ruc))) {
            return false;
        }
        if ((this.idSuministro == null && other.idSuministro != null) || (this.idSuministro != null && !this.idSuministro.equals(other.idSuministro))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.ProveedorSuministroPK[ruc=" + ruc + ", idSuministro=" + idSuministro + "]";
    }

}
